package stage.factory;

import java.util.*;

import stage.dao.impl.*;
/**
 * the factory of DAOs. 
 * @author remi liu(Liu Zhibin)
 * @version 0.0
 */
public class DaoFactory {
	private Map<String, Object> daoMap=new HashMap<String, Object>();
	private static DaoFactory df;
	private DaoFactory()throws Exception
	{
		daoMap.put("HistoricalInfoDAO", new HistoricalInfoDAOImpl());
		daoMap.put("HistoricalInfosDAO", new HistoricalInfosDAOImpl());
	}
	public static DaoFactory instance() throws Exception
	{
		if(df==null){
			df=new DaoFactory();
		}
		return df;
	}
	public Object getDao(String id){
		return daoMap.get(id);
	}
}
